package dr.joketalker.model;

import java.io.File;
import java.io.IOException;
import java.net.SocketException;

import org.apache.commons.net.ftp.FTPClient;

public class MyFtpClient extends FTPClient {

	/*Ran this from the Windows command prompt (Run As Administrator) 
	 * as a workaround to disable stateful FTP filtering so that Windows
	 *  Firewall will not block FTP traffic.
		netsh advfirewall set global StatefulFtp disable
*/
	
	
	
	
	final static String host = "joketalker.net78.net";
	final static String username = "a9275710";
	final static int port = 21;
	final static String password = "redred733";
	
	final static String JOKEDIRECTORY = "joketalker"+File.separator+"joke";
	
	static MyFtpClient stMyFtpClient = null;
	
	public static MyFtpClient getInstance(){
		if(stMyFtpClient == null){
			stMyFtpClient = new MyFtpClient();
		}
		return stMyFtpClient;
	}

	
	
	public void connect() throws SocketException, IOException {
		connect(host);
	}
	
	public boolean login() throws IOException {
		// TODO Auto-generated method stub
		return login(username, password);

	}
}
